{include file="public/layout" /}
 
<style type="text/css">
html, body {
	overflow: visible;
}
</style>
<body class="laytp-container">
<div class="layui-card" id="search-form">
  <div class="layui-card-body">
    <div class="layui-fluid">
  <div class="layui-row layui-col-space15">
    <div class="layui-card layui-col-md12">
      <div class="layui-card-header">
        绑定小程序
      </div>
      <div class="layui-card-body" pad15>
        <div class="layui-form form-label-w10" lay-filter="" style="margin-top:20px">
          <!-- <div class="layui-form-item">
              <div style="padding-left:20px;color:#f00">注意：选择该方式上传，如果您的小程序已授权，请先在[设置]-[第三方设置]中取消授权</div>
          </div> -->
          <div class="layui-form-item">
            <div style="padding-left:20px;font-weight:bold">一、填写小程序信息</div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">AppID：</label>
            <div class="layui-input-inline" style="width:200px">
              <input type="hidden" name="id" value="{$info.id}" />
              <input type="text" name="appid" value="{$info.appid}" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">登录微信小程序平台(mp.weixin.qq.com)[开发]-[基本配置]中查找</div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">AppSecret：</label>
            <div class="layui-input-inline" style="width:280px">
              <input type="text" name="appsecret" value="{$info.appsecret}" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">登录微信小程序平台(mp.weixin.qq.com)[开发]-[基本配置]中查找</div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">小程序名称：</label>
            <div class="layui-input-inline" style="width:280px">
              <input type="text" name="wxname" value="{$info.wxname}" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">小程序码：</label>
            <input type="hidden" name="qrcode" id="qrcode" lay-verType="tips" class="layui-input" value="{$info.qrcode}">
            <button style="float:left;" type="button" class="layui-btn layui-btn-primary" upload-input="qrcode" upload-preview="qrcodePreview" onclick="uploader(this)">上传图片</button>
            <div id="qrcodePreview" class="picsList-class-padding" style="float:left;margin-left:110px;clear: both;">
              <div class="layui-imgbox" style="width:100px;"><div class="layui-imgbox-img"><img src="{$info.qrcode}"/></div></div>
            </div>
          </div>
          <div class="layui-form-item">
            <div style="padding-left:20px;font-weight:bold">二、设置IP白名单及域名</div>
          </div>
          <div class="layui-form-item" style="margin-bottom:5px">
            <label class="layui-form-label">IP白名单：</label>
            <div class="layui-form-mid" style="width:200px;font-weight:bold">{$web_info['ip']}</div>
            <div class="layui-form-mid layui-word-aux">[设置与开发]-[基本配置]-[IP白名单]中设置</div>
          </div>
          <div class="layui-form-item" style="margin-bottom:5px">
            <label class="layui-form-label">业务域名：</label>
            <div class="layui-form-mid" style="width:200px;font-weight:bold">{$web_info['https_url']}</div>
            <div class="layui-form-mid layui-word-aux">[设置与开发]-[公众号设置]-[功能设置]中设置</div>
          </div>
          <div class="layui-form-item" style="margin-bottom:5px">
            <label class="layui-form-label">JS接口安全域名：</label>
            <div class="layui-form-mid" style="width:200px;font-weight:bold">{$web_info['https_url']}</div>
            <div class="layui-form-mid layui-word-aux">[设置与开发]-[公众号设置]-[功能设置]中设置</div>
          </div>
          <div class="layui-form-item" style="margin-bottom:5px">
            <label class="layui-form-label">网页授权域名：</label>
            <div class="layui-form-mid" style="width:200px;font-weight:bold">{$web_info['https_url']}</div>
            <div class="layui-form-mid layui-word-aux">[设置与开发]-[公众号设置]-[功能设置]中设置</div>
          </div>
          <div class="layui-form-item">
            <div style="padding-left:20px;font-weight:bold">三、配置服务器域名</div>
          </div>
          <div class="layui-form-item" style="margin-bottom:0">
            <div class="layui-form-mid" style="margin-left:40px;">登录微信小程序平台(mp.weixin.qq.com)在[设置与开发]-[基本配置]-[服务器配置]，配置以下信息：</div>
          </div>
          <div class="layui-form-item" style="margin-bottom:5px">
            <div class="layui-form-mid" style="margin-left:40px;color:red">注意：填写完成以下信息后需先点击下方保存按钮，再在公众平台点击提交按钮，否则会校验失败</div>
          </div>
          <div class="layui-form-item" style="margin-bottom:5px">
            <label class="layui-form-label">URL(服务器地址)：</label>
            <div class="layui-form-mid" style="width:700px;font-weight:bold" id="fwqurl">{$web_info['wechat_url']}</div>
            <div class="layui-form-mid layui-word-aux"></div>
          </div>
          <div class="layui-form-item" style="margin-bottom:5px">
            <label class="layui-form-label">Token(令牌)：</label>
            <div class="layui-input-inline" style="width:400px">
              <input type="text" name="token" value="{$info.token}" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux"></div>
          </div>
          <div class="layui-form-item" style="margin-bottom:5px">
            <label class="layui-form-label">EncodingAESKey(消息加密密钥)：</label>
            <div class="layui-input-inline" style="width:400px">
              <input type="text" name="encode" value="{$info.encode}" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item" style="margin-bottom:5px">
            <label class="layui-form-label">消息加解密方式：</label>
            <div class="layui-form-mid" style="width:200px;font-weight:bold">安全模式</div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label"></label>
            <div class="layui-input-inline" style="width:500px">
              <button class="layui-btn layui-btn-normal" lay-submit lay-filter="submit_wx">保 存</button>
              <button class="layui-btn layui-btn-primary" type="button" id="uploadjstxt">上传公众号接口校验文件</button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
  </div>
</div>
<script>
  layui.use(function() {
    layui.form.on('submit(submit_wx)', function(obj){
      var field = obj.field
      $.post('',obj.field,function(data){
        dialog(data.msg,data.status);
      })
    })
    layui.upload.render({
      elem: '#uploadjstxt', //绑定元素
      url: "{:url('uploadjstxt')}", //上传接口
      exts:'txt',
      done: function(res){
        //上传完毕回调
        console.log(res)
        dialog(res)
      },
      error: function(){
        //请求异常回调
      }
    });
  })
</script>
</body>
</html>